<template>
  <div class="stuff-info">
    <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button>

    <el-dialog
      title="员工信息"
      v-model="dialogVisible"
      width="30%"
    >
      <div class="container">
        <div class="img-left">
          <div class="img">
            <img src="" alt="">
          </div>
          <span class="number">{{ configObject.IdentificationNumber }}</span>
        </div>
        <div class="info-right">
          <p class="name">
            <span>{{ configObject.name }}</span>
            <span>先生</span>
          </p>
          <p class="email">
            <span>邮箱</span>
            <span>{{ configObject.email }}</span>
          </p>
          <p class="mobile-phone">
            <span>手机</span>
            <span>{{ configObject.mobilePhone }}</span>
          </p>
          <p class="telephone">
            <span>座机</span>
            <span>{{ configObject.telephone }}</span>
          </p>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
        </span>
      </template>
    </el-dialog>

  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  props: {
    configObject: {
      type: Object,
      default: () => {
        return {
          IdentificationNumber: '123',
          name: '张全蛋',
          email: '123456@qq.com',
          mobilePhone: '12345678900',
          telephone: '654321'
        }
      }
    }
  },
  setup() {
    let dialogVisible = ref(false)
  
    return {
      dialogVisible
    }
  }
})
</script>

<style lang="scss" scoped>
.stuff-info {
  :deep .el-dialog {
    border-radius: 4px;
  }
  :deep .el-dialog__header {
    background-color: #03308E;
    border-radius: 4px 4px 0px 0px;
    padding-top: 10px;
  }
  :deep .el-dialog__title {
    color: #fff;
    font-size: 16px;
  }
  :deep .el-dialog__headerbtn {
    top: 14px;
  }
  :deep .el-dialog__footer {
    background-color: #F6F6F6;
    padding-bottom: 10px;
    border-radius: 0px 0px 4px 4px;
  }

  .container {
    display: grid;
    grid-template-columns: 40% 60%;
  }
  .img-left {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    .img {
      width: 50px;
      height: 50px;
      border: 1px solid #000;
      border-radius: 25px;
    }
    .number {
      text-align: center;
    }
  }
}
</style>